package cn.iocoder.yudao.module.iot.service;

import cn.iocoder.yudao.module.iot.dal.dataobject.IotPluginInstanceDO;
import cn.iocoder.yudao.module.iot.dal.mysql.IotPluginInstanceMapper;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import java.util.List;

@Service
public class IotPluginInstanceServiceImpl implements IotPluginInstanceService {
    @Resource
    private IotPluginInstanceMapper pluginInstanceMapper;

    @Override
    public Long createPluginInstance(IotPluginInstanceDO instance) {
        pluginInstanceMapper.insert(instance);
        return instance.getId();
    }

    @Override
    public void updatePluginInstance(IotPluginInstanceDO instance) {
        pluginInstanceMapper.updateById(instance);
    }

    @Override
    public void deletePluginInstance(Long id) {
        pluginInstanceMapper.deleteById(id);
    }

    @Override
    public IotPluginInstanceDO getPluginInstance(Long id) {
        return pluginInstanceMapper.selectById(id);
    }

    @Override
    public List<IotPluginInstanceDO> getPluginInstanceList() {
        return pluginInstanceMapper.selectList(null);
    }
} 